<!DOCTYPE html>
<html>
<head>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

</head>

<body>

系统载入中，请稍等...

<?php
//验证登陆信息
session_start();

include_once("../config.php");
include_once '../connection.php';

$resetpassword_yzm = $_POST['resetpassword_yzm'];
$userpass = $_POST['userpass'];
$userpass_re = $_POST['repass'];
$email = $_POST['email'];
$resetpassword_id = $_SESSION['resetpassword_id'];
if($_SESSION['resetpassword_yzm'] != $resetpassword_yzm){
    echo "<script language='javascript'>alert('验证码不正确！');location='resetpass.php';</script>";
    exit;
}

if (strlen($userpass) < 6 && strlen($userpass) > 12 ) {echo "<script language='javascript'>alert('请输入正确的密码长度！');location='resetpass.php';</script>";exit;}
if($userpass != $userpass_re){echo "<script language='javascript'>alert('密码不匹配！');location='resetpass.php';</script>"; exit;}



$table = $table_Prefix."company";

$sql=" UPDATE $table SET password='".md5($userpass)."' where nid = '$resetpassword_id'";
    $query = mysql_query($sql) or die ('更新数据失败');
    mysql_close($con);

unset($_SESSION['resetpassword_yzm']);
unset($_SESSION['resetpassword_id']);
echo '<script type="text/javascript">alert("更改密码成功，点击确认返回继续操作.");document.location.href = "index.php";</script>';


?>
</body>